package com.ruoyi.project.cms.sm.role.domain;

import com.ruoyi.framework.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author ：MrL
 * 时间：2020-05-19
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SMRole extends BaseEntity {

    // 角色ID
    private Long roleId;

    // 角色名称
    private String roleName;

    // 角色排序ID
    private Integer roleSort;

    // 备注
    private String remark;

    /**
     * 菜单组
     */
    private Long[] menuIds;

    public SMRole(Long roleId) {
        this.roleId = roleId;
    }

    public boolean isAdmin() {
        return isAdmin(this.roleId);
    }

    public static boolean isAdmin(Long roleId) {
        return roleId != null && 1L == roleId;
    }
}
